Compile-Time Debugging of C Programs Working on Trees
نویسندگان
چکیده
We exhibit a technique for automatically verifying the safety of simple C programs working on tree-shaped data structures. We do not consider the complete behavior of programs, but only attempt to verify that they respect the shape and integrity of the store. A verified program is guaranteed to preserve the tree-shapes of data structures, to avoid pointer errors such as NULL dereferences, leaking memory, and dangling references, and furthermore to satisfy assertions specified in a specialized store logic. A program is transformed into a single formula in WSRT, an extension of WS2S that is decided by the MONA tool. This technique is complete for loop-free code, but for loops and recursive functions we rely on Hoarestyle invariants. A default well-formedness invariant is supplied and can be strengthened as needed by programmer annotations. If a program fails to verify, a counterexample in the form of an initial store that leads to an error is automatically generated. This extends previous work that uses a similar technique to verify a simpler syntax manipulating only list structures. In that case, programs are translated into WS1S formulas. A naive generalization to recursive datatypes determines an encoding in WS2S that leads to infeasible computations. To obtain a working tool, we have extended MONA to directly support recursive structures using an encoding that provides a necessary state-space factorization. This extension of MONA defines the new WSRT logic together with its decision procedure.
منابع مشابه
A Framework for Assertion-Based Debugging in Constraint Logic Programming
A b s t r a c t . We propose a general framework for assertion-based debugging of constraint logic programs. Assertions are linguistic constructions which allow expressing properties of programs. We define assertion schemas which allow writing (partial) specifications for constraint logic programs using quite general properties, including user-defined programs. The framework is aimed at detecti...
متن کاملStatic Deadlock Analysis for CSP-type Communications
We present two tests for analyzing deadlock for a class of communicating sequential processes. The tests can be used for deadlock detection in parallel and distributed programs at compile time, or for debugging purposes at run time. They can also be used in conjunction with an algorithm we have for constructing valid execution traces for this class.
متن کاملChecking C++ Programs for Dimensional Consistency
Computer simulations and other scientific programs often deal with physical quantities that have dimensional meanings, like length scales or time scales. The internal representation of such quantities is done by floating point numbers. The actual numbers have no direct meaning by themselves. Their meanings rely on the definition of the measuring units (for example, the length ’5 meters’ could e...
متن کاملA Framework for Assertion - based Debuggingin Constraint Logic
We propose a general framework for assertion-based debugging of constraint logic programs. Assertions are linguistic constructions which allow expressing properties of programs. We deene assertion schemas which allow writing (partial) speciications for constraint logic programs using quite general properties, including user-deened programs. The framework is aimed at detecting deviations of the ...
متن کاملDebugging Multi-Threaded Applications using Pin-Augmented GDB (PGDB)
In contrast to single threaded applications, debugging multi-threaded applications is complex because of the non-deterministic nature of concurrent programs. Multiple threads in concurrent programs introduce bugs like datarace, deadlock and livelock. Popular debuggers like GNU Debugger (GDB), Intel Debugger (IDB) and Microsoft Visual Studio Debugger (MVSD) typically use static or compile-time i...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2000